use glam::Vec3;

pub struct Ball {
    location: Vec3,
    speed: Vec3,
}

impl Ball {
    pub fn new() -> Ball{
        Ball{location : Vec3 { x: 100.0, y: 100.0, z: 100.0 }, speed : Vec3 { x: 1.5, y: 2.3, z: 3.2 }}
    }
    pub fn get_location(& self) -> Vec3 {
        self.location
    }
    pub fn step(&mut self) {
        self.location += self.speed;
        if (self.location.x>284.0) || (self.location.x<16.0) {
            self.speed.x *= -1.0
        }
        if (self.location.y>284.0) || (self.location.y<16.0) {
            self.speed.y *= -1.0
        }
        if (self.location.z>284.0) || (self.location.z<16.0) {
            self.speed.z *= -1.0
        }
    }
}